<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
	<CodeSnippet Format="1.0.0">
		<Header>
			<Title>instance</Title>
			<Shortcut>instance</Shortcut>
			<Description>单例的代码片段</Description>
			<Author>DGP Studio</Author>
			<SnippetTypes>
				<SnippetType>Expansion</SnippetType>
			</SnippetTypes>
		</Header>
		<Snippet>
			<Declarations>
				<Literal Editable="false">
					<ID>classname</ID>
					<ToolTip>类名</ToolTip>
					<Function>ClassName()</Function>
					<Default>ClassNamePlaceholder</Default>
				</Literal>
			</Declarations>
			<Code Language="csharp"><![CDATA[#region 单例
        private static volatile $classname$? instance;
        [SuppressMessage("", "IDE0044")]
        private static object _locker = new();
        private $classname$() { }
        public static $classname$ Instance
        {
            get
            {
                if (instance is null)
                {
                    lock (_locker)
                    {
                        instance ??= new();
                    }
                }
                return instance;
            }
        }
        #endregion]]>
			</Code>
		</Snippet>
	</CodeSnippet>
</CodeSnippets>
